package com.net.xpay.core.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 2020/6/6 11:43

 */
@Getter
@Setter
@NoArgsConstructor
public class TaokeResponse {
    @ApiModelProperty(notes = "状态：1:淘客订单 0:非淘客订单 3:查询错误")
    private Integer state;

    @ApiModelProperty(notes = "成功或错误的提示信息")
    private String msg;

    public static TaokeResponse getInstance(Integer state, String msg) {
        TaokeResponse instance = new TaokeResponse();
        instance.setState(state);
        instance.setMsg(msg);

        return instance;
    }

    public boolean isSuccess() {
        return state == 0 || state == 1;
    }
}
